﻿<Window x:Class="ImageTagEditor.ImageTagOptionsDialog"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:custom="clr-namespace:ImageTagEditor"
		Title="Options" 
		Height="314" 
		Width="300" 
		WindowStartupLocation="CenterOwner" 
		WindowStyle="ToolWindow" 
		ShowInTaskbar="False" 
		ResizeMode="NoResize"
		x:Name="dialog">
	<Window.Resources>
		<Thickness x:Key="itemMargin">5,0,5,0</Thickness>
	</Window.Resources>
    <Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="auto" />
			<RowDefinition Height="auto" />
			<RowDefinition Height="auto" />
			<RowDefinition Height="auto" />
			<RowDefinition Height="auto" />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*" />
		</Grid.ColumnDefinitions>
		
		<!-- Load -->
		<GroupBox Header="Tags to Load"
				  Grid.Row="0"
				  Grid.Column="0">
			<GroupBox.ToolTip>
				<custom:PowerToolTip Header="Tags to Load"
									 Error=""
									 MaxWidth="{StaticResource toolTipMaxWidth}">
					<custom:PowerToolTip.Description>
						<TextBlock TextWrapping="WrapWithOverflow">
							Select which tag systems will be read when an image is loaded.
						</TextBlock>
					</custom:PowerToolTip.Description>
				</custom:PowerToolTip>
			</GroupBox.ToolTip>
			
			<StackPanel Orientation="Horizontal">
				<CheckBox x:Name="loadExifCheckBox"
						  VerticalAlignment="Center"
						  Margin="{StaticResource itemMargin}"
						  IsChecked="{Binding ElementName=dialog, Path=LoadExif}">
					<CheckBox.ToolTip>
						<custom:PowerToolTip Header="Load Exif"
											 Error=""
											 MaxWidth="{StaticResource toolTipMaxWidth}">
							<custom:PowerToolTip.Description>
								<StackPanel Orientation="Vertical">
									<TextBlock TextWrapping="WrapWithOverflow">
										When selected Exif tags will be read when an image is loaded.
									</TextBlock>
									<TextBlock TextWrapping="WrapWithOverflow">
										Only available for JPEGs.
									</TextBlock>
								</StackPanel>
							</custom:PowerToolTip.Description>
						</custom:PowerToolTip>
					</CheckBox.ToolTip>
					Exif
				</CheckBox>
				
				<CheckBox x:Name="loadXMPExifCheckBox"
						  VerticalAlignment="Center"
						  Margin="{StaticResource itemMargin}"
						  IsChecked="{Binding ElementName=dialog, Path=LoadXMPExif}">
					<CheckBox.ToolTip>
						<custom:PowerToolTip Header="Load XMP Exif"
											 Error=""
											 MaxWidth="{StaticResource toolTipMaxWidth}">
							<custom:PowerToolTip.Description>
								<StackPanel Orientation="Vertical">
									<TextBlock TextWrapping="WrapWithOverflow">
										When selected Exif embedded XMP tags will be read when an image is loaded.
									</TextBlock>
									<TextBlock TextWrapping="WrapWithOverflow">
										Available for both JPEGs and PNGs.
									</TextBlock>
								</StackPanel>
							</custom:PowerToolTip.Description>
						</custom:PowerToolTip>
					</CheckBox.ToolTip>
					XMP Exif
				</CheckBox>
				
				<CheckBox x:Name="loadXMPCheckBox"
						  VerticalAlignment="Center"
						  Margin="{StaticResource itemMargin}"
						  IsChecked="{Binding ElementName=dialog, Path=LoadXMP}">
					<CheckBox.ToolTip>
						<custom:PowerToolTip Header="Load XMP"
											 Error=""
											 MaxWidth="{StaticResource toolTipMaxWidth}">
							<custom:PowerToolTip.Description>
								<StackPanel Orientation="Vertical">
									<TextBlock TextWrapping="WrapWithOverflow">
										When selected XMP tags will be read when an image is loaded.
									</TextBlock>
									<TextBlock TextWrapping="WrapWithOverflow">
										Available for both JPEGs and PNGs.
									</TextBlock>
								</StackPanel>
							</custom:PowerToolTip.Description>
						</custom:PowerToolTip>
					</CheckBox.ToolTip>
					XMP
				</CheckBox>
			</StackPanel>
		</GroupBox>
		
		<!-- Save -->
		<GroupBox Header="Tags to Save"
				  Grid.Row="1"
				  Grid.Column="0">
			<GroupBox.ToolTip>
				<custom:PowerToolTip Header="Tags to Save"
									 Error=""
									 MaxWidth="{StaticResource toolTipMaxWidth}">
					<custom:PowerToolTip.Description>
						<TextBlock TextWrapping="WrapWithOverflow">
							Select which tag systems will be written when an image is saved.
						</TextBlock>
					</custom:PowerToolTip.Description>
				</custom:PowerToolTip>
			</GroupBox.ToolTip>
			
			<StackPanel Orientation="Horizontal">
				<CheckBox x:Name="saveExifCheckBox"
						  VerticalAlignment="Center"
						  Margin="{StaticResource itemMargin}"
						  IsChecked="{Binding ElementName=dialog, Path=SaveExif}">
					<CheckBox.ToolTip>
						<custom:PowerToolTip Header="Save Exif"
											 Error=""
											 MaxWidth="{StaticResource toolTipMaxWidth}">
							<custom:PowerToolTip.Description>
								<StackPanel Orientation="Vertical">
									<TextBlock TextWrapping="WrapWithOverflow">
										When selected Exif tags will be written when an image is saved.
									</TextBlock>
									<TextBlock TextWrapping="WrapWithOverflow">
										Available only for JPEGs.
									</TextBlock>
								</StackPanel>
							</custom:PowerToolTip.Description>
						</custom:PowerToolTip>
					</CheckBox.ToolTip>
					Exif
				</CheckBox>
				
				<CheckBox x:Name="saveXMPExifCheckBox"
						  VerticalAlignment="Center"
						  Margin="{StaticResource itemMargin}"
						  IsChecked="{Binding ElementName=dialog, Path=SaveXMPExif}">
					<CheckBox.ToolTip>
						<custom:PowerToolTip Header="Save XMP Exif"
											 Error=""
											 MaxWidth="{StaticResource toolTipMaxWidth}">
							<custom:PowerToolTip.Description>
								<StackPanel Orientation="Vertical">
									<TextBlock TextWrapping="WrapWithOverflow">
										When selected Exif embedded XMP tags will be written when an image is saved.
									</TextBlock>
									<TextBlock TextWrapping="WrapWithOverflow">
										Available for both JPEGs and PNGs.
									</TextBlock>
								</StackPanel>
							</custom:PowerToolTip.Description>
						</custom:PowerToolTip>
					</CheckBox.ToolTip>
					XMP Exif
				</CheckBox>
				
				<CheckBox x:Name="saveXMPCheckBox"
						  VerticalAlignment="Center"
						  Margin="{StaticResource itemMargin}"
						  IsChecked="{Binding ElementName=dialog, Path=SaveXMP}">
					<CheckBox.ToolTip>
						<custom:PowerToolTip Header="Save XMP"
											 Error=""
											 MaxWidth="{StaticResource toolTipMaxWidth}">
							<custom:PowerToolTip.Description>
								<StackPanel Orientation="Vertical">
									<TextBlock TextWrapping="WrapWithOverflow">
										When selected XMP tags will be written when an image is saved.
									</TextBlock>
									<TextBlock TextWrapping="WrapWithOverflow">
										Available for both JPEGs and PNGs.
									</TextBlock>
								</StackPanel>
							</custom:PowerToolTip.Description>
						</custom:PowerToolTip>
					</CheckBox.ToolTip>
					XMP
				</CheckBox>
			</StackPanel>
		</GroupBox>
		
		<!-- Tag Precedence -->
		<GroupBox Header="Tag System Precedence"
				  Grid.Row="2"
				  Grid.Column="0">
			<GroupBox.ToolTip>
				<custom:PowerToolTip Header="Tags System Precedence"
									 Error=""
									 MaxWidth="{StaticResource toolTipMaxWidth}">
					<custom:PowerToolTip.Description>
						<StackPanel Orientation="Vertical">
							<TextBlock TextWrapping="WrapWithOverflow">
								Select the precedence of the different tag systems to use
								for conflict resolution when loading.
							</TextBlock>
							<TextBlock TextWrapping="WrapWithOverflow">
								If multiple tag systems are selected to be loaded they
								may each have a different value for a common tag such as image description.
								The tag system precedence is used to decide which value will be read as the value
								1 being higher than 2, with 2 being higher than 3.
							</TextBlock>
						</StackPanel>

					</custom:PowerToolTip.Description>
				</custom:PowerToolTip>
			</GroupBox.ToolTip>
			
			<StackPanel Orientation="Vertical">
				<StackPanel Orientation="Horizontal"
							Margin="0,0,0,5">
					<RadioButton x:Name="exif_XMPExif_XMPRadioButton"
								 Margin="{StaticResource itemMargin}"
								 GroupName="Precedence" 
								 Checked="exif_XMPExif_XMPRadioButton_Checked" >
						<StackPanel Orientation="Vertical">
							<TextBlock>
							1. Exif
							</TextBlock>
							<TextBlock>
							2. XMP Exif
							</TextBlock>
							<TextBlock>
							3. XMP
							</TextBlock>
						</StackPanel>
					</RadioButton>

					<Separator />

					<RadioButton x:Name="xmpExif_Exif_XMPRadioButton"
								 Margin="{StaticResource itemMargin}"
								 GroupName="Precedence" 
								 Checked="xmpExif_Exif_XMPRadioButton_Checked">
						<StackPanel Orientation="Vertical">
							<TextBlock>
							1. XMP Exif
							</TextBlock>
							<TextBlock>
							2. Exif
							</TextBlock>
							<TextBlock>
							3. XMP
							</TextBlock>
						</StackPanel>
					</RadioButton>

					

					<RadioButton x:Name="xmp_Exif_XMPExifRadioButton"
								 Margin="{StaticResource itemMargin}"
								 GroupName="Precedence" 
								 Checked="xmp_Exif_XMPExifRadioButton_Checked">
						<StackPanel Orientation="Vertical">
							<TextBlock>
							1. XMP
							</TextBlock>
							<TextBlock>
							2. Exif
							</TextBlock>
							<TextBlock>
							3. XMP Exif
							</TextBlock>
						</StackPanel>
					</RadioButton>

					
				</StackPanel>
				<StackPanel Orientation="Horizontal"
							Margin="0,5,0,0">
					
					<RadioButton x:Name="exif_XMP_XMPExifRadioButton"
								 Margin="{StaticResource itemMargin}"
								 GroupName="Precedence" 
								 Checked="exif_XMP_XMPExifRadioButton_Checked">
						<StackPanel Orientation="Vertical">
							<TextBlock>
							1. Exif
							</TextBlock>
							<TextBlock>
							2. XMP
							</TextBlock>
							<TextBlock>
							3. XMP Exif
							</TextBlock>
						</StackPanel>
					</RadioButton>
					
					<RadioButton x:Name="xmpExif_XMP_ExifRadioButton"
								 Margin="{StaticResource itemMargin}"
								 GroupName="Precedence" 
								 Checked="xmpExif_XMP_ExifRadioButton_Checked">
						<StackPanel Orientation="Vertical">
							<TextBlock>
							1. XMP Exif
							</TextBlock>
							<TextBlock>
							2. XMP
							</TextBlock>
							<TextBlock>
							3. Exif
							</TextBlock>
						</StackPanel>
					</RadioButton>
					
					<RadioButton x:Name="xmp_XMPExif_ExifRadioButton"
								 Margin="{StaticResource itemMargin}"
								 GroupName="Precedence" 
								 Checked="xmp_XMPExif_ExifRadioButton_Checked">
						<StackPanel Orientation="Vertical">
							<TextBlock>
							1. XMP
							</TextBlock>
							<TextBlock>
							2. XMP Exif
							</TextBlock>
							<TextBlock>
							3. Exif
							</TextBlock>
						</StackPanel>
					</RadioButton>
					
				</StackPanel>
				
			</StackPanel>
		</GroupBox>
		
		
		<!-- Edit which tag are shown -->
		<GroupBox Header="Show/Hide Tags"
				  Grid.Row="3"
				  Grid.Column="0">
			<GroupBox.ToolTip>
				<custom:PowerToolTip Header="Show/Hide Tags"
									 Error=""
									 MaxWidth="{StaticResource toolTipMaxWidth}">
					<custom:PowerToolTip.Description>
						<StackPanel Orientation="Vertical">
							<TextBlock TextWrapping="WrapWithOverflow">
								Select which tags are shown or hidden. A check means it will
								be shown, unchecked will be hidden.
							</TextBlock>
						</StackPanel>
					</custom:PowerToolTip.Description>
				</custom:PowerToolTip>
			</GroupBox.ToolTip>

			<StackPanel Orientation="Horizontal">
				<CheckBox x:Name="showUserComment"
						  VerticalAlignment="Center"
						  Margin="{StaticResource itemMargin}"
						  IsChecked="{Binding ElementName=dialog, Path=ShowUserComment}">
					<CheckBox.ToolTip>
						<custom:PowerToolTip Header="Show User Comment"
											 Error=""
											 MaxWidth="{StaticResource toolTipMaxWidth}">
							<custom:PowerToolTip.Description>
								<StackPanel Orientation="Vertical">
									<TextBlock TextWrapping="WrapWithOverflow">
										When checked the user comment tag will be shown.
									</TextBlock>
								</StackPanel>
							</custom:PowerToolTip.Description>
						</custom:PowerToolTip>
					</CheckBox.ToolTip>
					Show User Comment
				</CheckBox>

				<CheckBox x:Name="showMakerNote"
						  VerticalAlignment="Center"
						  Margin="{StaticResource itemMargin}"
						  IsChecked="{Binding ElementName=dialog, Path=ShowMakerNote}">
					<CheckBox.ToolTip>
						<custom:PowerToolTip Header="Show Maker Note"
											 Error=""
											 MaxWidth="{StaticResource toolTipMaxWidth}">
							<custom:PowerToolTip.Description>
								<StackPanel Orientation="Vertical">
									<TextBlock TextWrapping="WrapWithOverflow">
										When checked the maker note tag will be shown
									</TextBlock>
								</StackPanel>
							</custom:PowerToolTip.Description>
						</custom:PowerToolTip>
					</CheckBox.ToolTip>
					Show Maker Note
				</CheckBox>
			</StackPanel>
		</GroupBox>
		
		<!-- OK/Cancel buttons-->
		<StackPanel Orientation="Horizontal"
					HorizontalAlignment="Right"
					Grid.Row="4"
					Grid.Column="0"
					Margin="5,5,5,5">
			<Button x:Name="okButton"
					Width="50"
					Margin="0,0,5,0" 
					Click="okButton_Click">
				OK
			</Button>
			<Button x:Name="cancelButton"
					Width="50" 
					Click="cancelButton_Click">
				Cancel
			</Button>
		</StackPanel>
	</Grid>
</Window>
